Quick Reference



Online IVR Tutorial

       Following are the functions and commands supported by the Xtend IVR engine.


A

The activeCalls() function obtains the number of calls active in the dialed line.
Syntax:
$numInteger = ActiveCalls(<dli>)

Tell me more!

The activePorts() function obtains the number of ports being monitored by the Xtend IVR.
Syntax:
$numInteger = ActivePorts()

Tell me more!

The alltrim() function trims all the leading and trailing white-space characters, tabs, carriage return and line feed from the string parameter and returns trimmed string.
Syntax:
$trimmedString = alltrim(<string>)

Tell me more!

The answer command causes the script to pickup the phone line after specified number of rings.
Syntax:
answer <no:of Rings>

Tell me more!

The ascii() function returns the ASCII code of the character entered.
Syntax:
$asciiCode = ascii(<character>)

Tell me more!

AtomicAdd() function increments the value of a variable in a particular device.
Syntax:
AtomicAdd(<deviceId>, <$variable>, <value>)

Tell me more!

AtomicGet() function gains access to the variables across devices.
Syntax:
$valueString = AtomicGet(<deviceId>, <$variable>)

Tell me more!

AtomicSet() function sets the value of a variable in a particular device.
Syntax:
AtomicSet(<deviceId>, <$variable>, <value>)

Tell me more!

B

The bgPlay command plays the specified .wav file in the background. If no extension is provided, .wav is assumed automatically.
Syntax:
BgPlay <wave file>

Tell me more!

The bgVolume command adjusts the background playback volume.
Syntax:
BgVolume <percent>

Tell me more!

The beep command produces a beep sound on the auxiliary multimedia device or on the phoneline, if connected.
Syntax:
Beep <frequency> <duration>

Tell me more!

The BlindTransfer() function blindly transfers the call to the particular extension phone.
Syntax:
$statusBoolean = BlindTransfer(<extensionNumber>)

Tell me more!

BP command automatically sets a break point inside the script.
Syntax:
BP

Tell me more!

The BREAK or EXIT command will cause the execution of the script to break out of the current WHILE loop.
Syntax:
Break

Tell me more!

C

The Calls() function obtains the number of calls handled by the current port.
Syntax:
$numInteger = Calls(<dli>)

Tell me more!

The chr() function will return the character if given its ASCII code.
Syntax:
$character = chr(<number>)

Tell me more!

The CLEAR command will immediately clear any pending ON, PLAY, RECORD and SPEAK commands and removes any pending keys from the input queue.
Syntax:
Clear

Tell me more!

ComClose() closes the serial port communication connection.
Syntax:
ComClose()

Tell me more!

ComOpen() establishes a connection with the serial port.
Syntax:
ComOpen("<Communication Port>", "<BaudRate> <Parity, Databits, Stopbits> <FlowControl>")

Tell me more!

The compare() function will compare two strings.
Syntax:
$integer = compare(<String1>, <String2>)

Tell me more!

ComRead() reads data from the serial port.
Syntax:
$buffer = ComRead(<Size>, <Timeout>)

Tell me more!

ComReadLine() reads a single line of data from the serial port.
Syntax:
$buffer = ComReadLine(<Timeout>)

Tell me more!

ComReadSize() finds out the size of the data in the serial port that are ready to be read.
Syntax:
$size = ComReadSize()

Tell me more!

ComWrite() writes data to the serial port.
Syntax:
comWrite(<buffer>)

Tell me more!

ComWriteLine() writes a line of data to the serial port.
Syntax:
ComWriteLine(<buffer>)

Tell me more!

The concat() function will return a copy of the string after appending all given strings (<string1>, <string2>, <string3>).
Syntax:
$concatenatedString = concat(<string1>, <string2>, <string3>)

Tell me more!

Convert() is used to convert the wave file into the specified wave format and saves it in a separate file.
Syntax:
$status = wave.Convert ("<Source Filename>","<Codec>","[Target Filename]")

Tell me more!

CountMessage() returns the total number of messages present in the message queue of the specified device.
Syntax:
$TotalMsg = CountMessage([DeviceId])

Tell me more!

D

The Datasize() function returns the data size of the wave file.
Syntax:
$size = wave.datasize ("<Wavefile>","[Compr]")

Tell me more!

DeleteFile() function deletes the specified file and returns boolean value true if file is deleted, false otherwise.
Syntax:
$boolean = DeleteFile(<filename>)

Tell me more!

DeviceSpecific() executes a function unique to a specific driver.
Syntax:
DeviceSpecific(<functionName>[, parameters])

Tell me more!

Dial() makes an outgoing call.
Syntax:
$bool = Dial(<Phone Number>)

Tell me more!

Display command prints messages in the Display area of the Main window.
Syntax:
Display <string>

Tell me more!

E

The Encrypt() function is to encrypt the wave file using the encryption type BLOWFISH or XOR.
Syntax
$bool = wave.Encrypt ("<Wave Filename>","<Password>","<Type>","[Destination File]")

Tell me more!

Escape() function converts the binary characters in the string to its percentage(%) hexa form.
Syntax:
$escapedString = Escape(<string>)

Tell me more!

The Exit command will cause the execution of the script to break out of the current WHILE loop.
Syntax:
Exit

Tell me more!

The ExtractXmlTag() function is used to retrieve the text in which the tag should be searched for and returns the text as per the specified offset value.
Syntax:
$xmltext = ExtractXmlTag ( <xmldata>, <starting tag>, <ending tag>, [offset] )

Tell me more!

F

The Find() function finds a character or substring inside a larger string and returns the zero-based index of the first character in the 'Master string'.
Syntax:
$index = Find(<Master string>, <Sub string>, [offset])

Tell me more!

Format() function writes formatted data to a string.
Syntax:
$formattedString = Format(fcString [,arguments]..)

Tell me more!

Fraction() function returns the fractional part of the number.
Syntax:
$Integer = Fraction(number)

Tell me more!

The Function keyword identifies the start of a user-defined function.
Syntax:
Function FunctionName ( Param1, Param2, ... )
       <statements>
Return [Expression]

Tell me more!

G

The Get() is to get specific web page.
Syntax
$Page = http.Get("<URL>")

Tell me more!

The GetCallProgress() function obtains the current status of a Dial() or Transfer() operation.
Syntax:
$statusString = GetCallProgress()

Tell me more!

The Get2File() is to get specific web page into a file.
Syntax
$Status = http.Get2File("<URL>","<Filename>")

Tell me more!

The GetInfo() function retrieves information from the driver DLL.
Syntax:
$infoString = GetInfo(<attribute>)

Tell me more!

The GetTag() function is used to retrieve the remark attached to a tag/label within the wave file.
Syntax
$bool=wave.GetTag ("<Wave Filename>","<Tag>")

Tell me more!

GetMessage() function fetches a string from the message queue of the specified device.
Syntax:
$msgString = GetMessage(<deviceId>)

Tell me more!

The GetStartTime() function generates the starting date and time of the IVR.
Syntax:
$dateTime = GetStartTime()

Tell me more!

The GetTickCount() retrieves the number of milliseconds that have elapsed since the system had started.
Syntax:
$intCount = GetTickCount()

Tell me more!

The GetTime() function fetches the local date and time.
Syntax:
$dateTime = GetTime()

Tell me more!

The GOTO command causes the control of the script to jump to the specified label and start execution from that position.
Syntax:
Goto <label>

Tell me more!

H

This command causes the script to hang-up the line.
Syntax:
Hangup

Tell me more!

The hashoffile() function gives the hash value of any type of file.
Syntax
$hash = md5.hashoffile("<filename>")

Tell me more!

The hashofstring() function gives the hash value of specified string.
Syntax
$hash = $hash = md5.hashofstring ("<String>")

Tell me more!

The hashofwavedata() function gives the hash value of of wave file.
Syntax
$hash = $hash = md5.hashofwavedata("<Wavefile>")

Tell me more!

I

The IF statement will check the <condition> and if it's true will execute the commands inside the <statements> block. If not true, the control will move to the next <condition> or block.
Syntax:
IF <condition> <statements> ELSE <statements> ENDIF

or

IF <condition1> <statements> ELSE IF <condition2> <statements> ENDIF

or

IF <condition1> <statements> ELIF <condition2> <statements> ENDIF

or

IF <condition>THEN GOTO <label>

Tell me more!

Index() function returns the zero-based index of a substring or a character inside a larger string. If sub string or character is not found, it will return -1. Index function has the same syntax as that of Find() function.
Syntax:
$index = Index(<Master string>, <Sub string>)

Tell me more!

The init() function is used to initialize the specific port in order to send and receive data.
Syntax
udp.init("<Port>")

Tell me more!

The input() function will accept numbers entered on the dial-pad by the user.
Syntax:
$inputKey = input(<max digits>, [wait in seconds], [enter key], [esc key], [mask])

Tell me more!

Integer() function returns the integral part of the number.
Syntax:
$Integer = Integer(number)

Tell me more!

IsVariable() function searches for the given variable anywhere inside the script and returns 1 if present, 0 otherwise.
Syntax:
$boolean = IsVariable("$variable")

Tell me more!

L

The left() function will return the leftmost length of the <string>.
Syntax:
$LeftString = left(<string>, <len>)

Tell me more!

The len() function will return the length of the <string>.
Syntax:
$length = len(<string>)

Tell me more!

The LOAD command will load all variables from the given file.
Syntax:
Load <filename>

Tell me more!

LoadFile() function loads the specified number of lines of text from the file to a variable.
Syntax:
$boolean = LoadFile(<filename>, <$variable>, <nooflines>)

Tell me more!

Lock() function permits one and only one script to execute inside a block of statements.
Syntax:
Lock(<name>)

Tell me more!

The Log command will log the given text into the log file maintained in the log directory.
Syntax:
Log <string>

Tell me more!

The Loop command will continue the looping in the While loop.
Syntax:
Loop

Tell me more!

The Loudness() function gives the maximum frequency of the wave within the given block size.
Syntax
$val = wave.loudness ("<Wave Filename >",[Block Size],"[Freqstoignore]")

Tell me more!

The lower() function will return a copy of the <string> converted to lowercase.
Syntax:
$lowerCaseString = lower(<string>)

Tell me more!

The ltrim() function will return a copy of the <string> after removing all the leading spaces.
Syntax:
$leadingSpaceTrimmedString = ltrim(<string>)

Tell me more!

M

The Merge() function merges two waves and store it in the specified location.
Syntax
$stat = wave.merge ("<Wavefile1>","<Wavefile2>","<Destination Filename>")

Tell me more!

Mid() function extracts a substring of length [len] characters from <string>.
Syntax:
$extractedString = mid(<string>, <start index>, [len])

Tell me more!

O

The ON command will cause a jump to the specified Label.
Syntax:
ON <key> GOTO <label>

Tell me more!

P

PLAY command will playback the specified .wav file on the phone line.
Syntax:
Play <wavefile1>[<wavefile2> <wavefile3> ... <wavefileN>]

Tell me more!

PlayTimeLeft() function returns the pending play back time in milliseconds.
Syntax:
$timeInteger = PlayTimeLeft()

Tell me more!

PutMessage() function places a string into the message queue of the specified device.
Syntax:
PutMessage(<deviceId>, <string>)

Tell me more!

R

The Random() function returns a random number less than the given number.
Syntax:
$intNum = Random(<number>)

Tell me more!

The RECORD command will record the incoming voice.
Syntax:
Record <seconds>

Tell me more!

The receive() function used to receive UDP data from a specific UDP port
Syntax
udp.receive("<Timeout>")

Tell me more!

The RecordTimeLeft() function returns the remaining time for recording.
Syntax:
$timeInteger = RecordTimeLeft()

Tell me more!

The Restart command restarts Xtend IVR from Script.
Syntax:
Restart

Tell me more!

The Reject command rejects the incoming calls.
Syntax:
Reject

Tell me more!

The Reverse() function reverses a given string.
Syntax:
$index = Reverse(<Master string>, <Sub string>)

Tell me more!

The ReverseFind() function finds a character or substring inside a larger string starting the search from the end.
Syntax:
$index = ReverseFind(<Master string>, <Sub string>)

Tell me more!

The right() function will return the rightmost length of the <string>.
Syntax:
$RightString = right(<string>, <len>)

Tell me more!

Rindex() function returns the zero-based index of a substring or a character inside a larger string starting the search from the end. Rindex() has the same syntax as that of ReverseFind() function.
Syntax:
$index = Rindex(<Master string>, <Sub string>)

Tell me more!

The rtrim() function will return a copy of the <string> after removing all the trailing whitespaces.
Syntax:
$trailingSpaceTrimmedString = rtrim(<string>)

Tell me more!

The RUN command will execute the specified program.
Syntax:
Run <exe file>

or
! <exe file>

Tell me more!

The RUNTIMEOUT command sets the timeout in seconds for any subsequent RUN commands.
Syntax:
Runtimeout <seconds>

Tell me more!

S

The Save command will save all variables to the given file.
Syntax:
Save <filename>

Tell me more!

SaveFile() function replaces the content from the variable with that of the file by the specified number of lines.
Syntax:
$boolean = SaveFile(<filename>, <$variable>, <nooflines>)

Tell me more!

The seconds() function gives the time elapsed in seconds after the process has started.
Syntax:
$timePeriod = seconds()

Tell me more!

The send() function sends data to the UDP port of the specified IP address.
Syntax
udp.send("<IP>",<Port>,"<Data>")

Tell me more!

The SetInfo() function sets the attribute of the driver.
Syntax:
SetInfo(<attribute>, <value>)

Tell me more!

The SetTag() Used to add a tag/label within the wave file.
Syntax
$bool=wave.SetTag ("<Wave Filename>","<Tag>","<Remark>")

Tell me more!

The SetVariable() function changes the scope of the variable from local to global and assigns value to all instances of the variable.
Syntax
SetVarInVar(<variable>, <value>)

Tell me more!

The Sleep command suspends the execution of the current script for a specified interval.
Synatx
Sleep <duration>

Tell me more!

The SleepEvent command suspends the execution of the current script for a specified interval of time or until an event occurs.
Syntax:
SleepEvent <duration>

Tell me more!

SoftDisconnect() function destroys a softInterconnect with a specified device.
Syntax:
SoftDisconnect(<deviceId>)

Tell me more!

SoftInterConnect() function interconnects the current device and the specified device.
Syntax:
SoftInterConnect(<deviceId>)

Tell me more!

SoftListen() function listens to a particular channel.
Syntax:
SoftListen(<deviceId>[, Type])

Tell me more!

SoftStream() function streams the Incoming, Outgoing or both audio of the current device to the incoming audio of the specified device.
Syntax:
SoftStream(<deviceId>[, Type])

Tell me more!

SoftUnlisten() function unlistens from the specified device.
Syntax:
SoftUnlisten(<deviceId>)

Tell me more!

SoftUnstream() function releases SoftStream() to the specified device.
Syntax:
SoftUnstream(<deviceId>)

Tell me more!

The SPEAK command will speak out the given text.
Syntax:
speak [String]

Tell me more!

The srAcceptWords() function defines the grammar for the subsequent Input() operation.
Syntax:
srAcceptWords(<word 1>, <word 2>, ..., <word N>)

Tell me more!

The srAudio() function specifies when the audio play back has to be stopped.
Syntax:
srAudio (<type>)

Tell me more!

The srConfidence() function determines the level of recognition for the words/grammar defined.
Syntax:
$levelInteger = srConfidence()

Tell me more!

The srGrammar() function loads grammar for speech recognition in the script.
Syntax:
srGrammar(<fileName>)
or
srGrammar(<actualXmlText>)

Tell me more!

The srKeepGrammar() function sets the grammar for the subsequent Input() operation in the script.
Syntax:
srKeepGrammar(<boolean>)

Tell me more!

SubStr() function extracts a substring from a larger string and has the same syntax as that of mid() function.
Syntax:
$extractedString = substr(<string>, <start index>, [len])

Tell me more!

T

The TIMEOUT command sets the timeout in seconds for an incoming call.
Syntax:
Timeout <seconds>

Tell me more!

The TotalCalls() function obtains the total number of calls handled by the IVR so far.
Syntax:
$numInteger = TotalCalls()

Tell me more!

The Transfer() function transfers the call to an extension phone.
Syntax:
$statusString = Transfer(<extensionNumber>, <timeout>)

Tell me more!

The Type() function returns the type of the wave file.
Syntax
$val = wave.type ("<Wavefile>")

Tell me more!

U

The upper() function will return a copy of the <string> converted to uppercase.
Syntax:
$upperCaseString = upper(<string>)

Tell me more!

The UnEscape() function reverses the Escape() process.
Syntax:
$unEscapedString = UnEscape(<string>)

Tell me more!

The UnLock() function releases the last Lock() operation.
Syntax:
UnLock()

Tell me more!

V

VoiceLog command logs the telephony audio to a specified file.
Syntax:
VoiceLog <waveFile>

Tell me more!

Volume command will adjust the playback volume of the specified .wav file.
Syntax:
Volume <percent>

Tell me more!

W

The WAIT command will wait for the specified number of milliseconds.
Syntax:
Wait <milliseconds>

Tell me more!

The WHILE command will check the <condition> and if it's true will execute the commands inside the <statements> block until the condition becomes false.
Syntax:
while <condition>
      <statements>
endwhile

Tell me more!